package com.sheng.project.wechat.feign;

import com.sheng.project.wechat.dto.AccessTokenResponse;
import com.sheng.project.wechat.dto.TicketResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author by ls
 * @date 2023/8/11
 */
@FeignClient(name = "${application.feign.wx.name:wechat}", url = "${application.feign.wx.url:https://api.weixin.qq.com/cgi-bin}")
public interface WeChatFeignClient {

    @GetMapping(value = "/token")
    AccessTokenResponse getToken(@RequestParam("grant_type") String grantType, @RequestParam("appid") String appid, @RequestParam("secret") String secret);

    @GetMapping(value = "/ticket/getticket")
    TicketResponse getTicket(@RequestParam("access_token") String accessToken, @RequestParam("type") String type);
}
